#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
    int partitionDisjoint(vector<int>& nums) {
        int n = nums.size();
        vector<int> rmax(n);
        rmax[n - 1] = nums[n - 1];
        for (int i = n - 2; i >= 0; i--) {
            rmax[i] = min(rmax[i + 1], nums[i]);
        }
        int res = 1;
        int cur = nums[0];
        for (int i = 1; i < n; i++) {
            if (cur <= rmax[i]) {
                return i;
            }
            cur = max(cur, nums[i]);
        }
        return n;
    }
};
int main()
{
	return 0;
}